package com.fangwaii.core.socket;

import io.netty.channel.Channel;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;

/**
 * @author lxc18
 * @date 2024/11/29 11:14
 * @description BaseHandler
 */
public abstract class BaseHandler<T> extends SimpleChannelInboundHandler<T> {
    @Override
    protected void channelRead0(ChannelHandlerContext channelHandlerContext, T t) throws Exception {
        session(channelHandlerContext,channelHandlerContext.channel(),t);
    }
    protected abstract void session(ChannelHandlerContext channelHandlerContext, final Channel channel, T request);
}
